﻿//using Newtonsoft.Json;
//using Newtonsoft.Json.Serialization;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using System.Web;
//using System.Web.Mvc;

//namespace MX.Core.Http.MVC.Result
//{
//    public class JsonNetResult : JsonResult
//    {
//        public JsonSerializerSettings SerializerSettings { get; set; }
//        public Formatting Formatting { get; set; }
//        public JsonNetResult()
//        {
//            SerializerSettings = new JsonSerializerSettings();
//			SerializerSettings.DateFormatString="yyyy-MM-dd HH:mm:ss";
//            SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
//        }
//        public override void ExecuteResult(ControllerContext context)
//        {
//            if (context == null)
//                throw new ArgumentNullException("context");
//            HttpResponseBase response = context.HttpContext.Response;
//            response.ContentType =
//                !string.IsNullOrEmpty(ContentType) ? ContentType : "application/json";
//            if (ContentEncoding != null)
//                response.ContentEncoding = ContentEncoding;
//            if (Data != null)
//            {
//                JsonTextWriter writer = new JsonTextWriter(response.Output)
//                {
//                    Formatting = Formatting
//                };
//                JsonSerializer serializer = JsonSerializer.Create(SerializerSettings);
//                serializer.Serialize(writer, Data); writer.Flush();
//            }
//        }
//    }

//}
